<template>
  <div class="field myfield custom">
      <field_title v-if="components_name != 'from_vals'" :title_show="!field.hideTitle&&!field.no_title" :field="field" ></field_title>
    <component  v-if='components_name && field' :is='components_name' :ref='components_name' :param="param" :field="field" :ctl="ctl"  @setVo='toSetEditVo' :editType="editType"></component>
  </div>
</template>

<script>
  import tool from 'src/util/tool';
  import util from '_util/index';

  import errmsg from 'components/valid/errmsg';
  import field_title from 'components/field/com/field_title';
  import ct1 from 'components/field/ct1';
  import pr from 'components/field/pr';
  import ct2 from 'components/field/ct2';
  import preset_time from 'components/field/custom/preset_time';
  import product_introduction from 'components/field/custom/product_introduction';
  import rili_product from 'components/field/custom/rili_product';
  import rili_whprod from 'components/field/custom/rili_whprod';
  import show_fields from 'components/field/custom/show_fields';
  import addck from 'components/field/custom/addck';
  import product_attr from 'components/field/custom/product_attr';
  import attr_zdy1 from 'components/field/custom/attr_zdy1';
  import from_vals from 'components/field/custom/from_vals';
  import EditProductType from 'components/field/custom/EditProductType';
  import choose_auth from 'components/field/custom/choose_auth';
  import menu_auth from 'components/field/custom/menu_auth';
  import end_date from 'components/field/custom/end_date';
  import sceniclist from 'components/field/custom/sceniclist';
  const store=util.store

  export default {
    data() {
      return {
        val: '',
      }
    },
    components:{
      errmsg,
        field_title,
      ct1,
      pr,
      ct2,
      preset_time,
      product_introduction,
      rili_product,
      addck,
      product_attr,
      rili_whprod,
      show_fields,
      attr_zdy1,
      choose_auth,
      from_vals,
        menu_auth,
      EditProductType,
      end_date,
	  sceniclist
    },
    methods: {
      toSetEditVo(name, val) {
        this.$emit('setVo', name, val)
      },
      doActive(params){
        for(let ref in this.$refs){
          if(this.$refs[ref].doActive){
            this.$refs[ref].doActive(params);
          }
        };
      }
    },
    watch: {
    },
    computed: {
      components_name() {
        if(!this.field)
          return null;
        return this.field.custom;
      },
    },
    props: ['field', 'ctl', "param", 'editType'],
    created() {
    },
  };
</script>

<style scoped>
  .field {}
</style>
